home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
201-220
/
scopedisk214
/
skeleton
/
public.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-19
|
2KB
|
71 lines
/*
* public.c - Public functions for skeleton class
*
* Public Domain
*
* Christian E. Hopps.
*
*/
#include <skeleton_internal.h>
#include <skeleton.h>
#include <proto/intuition.h>
/* set this to true if you have registered your class with CATS */
/* #define SKELETON_PUBLIC */
/* if your class is public (registered with CATS) this would be a */
/* null-terminated string to identify your class. ie."imageclass" */
#define SKELETON_ID (NULL)
/* this needs to be a null-terminated string that identfies your */
/* public superclass, other wise you need to pass a pointer to */
/* class when you call make class. */
#define SUPERCLASS_ID ("rootclass")
/* this would be equal to the size of your instance data that the */
/* "rootclass" should allocate for you. */
#define SKELETON_INSTANCE_SIZE (0L)
#define SKELETON_FLAGS (0L)
Class * Skeleton_init( void )
{
Class *class;
class = MakeClass( SKELETON_ID, /* your ID */
SUPERCLASS_ID, /* superclass string id. */
NULL, /* superclass ptr if not public */
SKELETON_INSTANCE_SIZE, /* size of instance data */
SKELETON_FLAGS ); /* flags (0L for now.) */
if(class == NULL) {
return(NULL);
}
/*
* set up a pointer to the dispatcher function, if we had not used
* SAS/C __asm calling conventions with the dispatcher fucntion,
* we would have put an asembler stub routine in, that would then call
* the h_SubEntry.
*/
class->cl_Dispatcher.h_Entry = Skeleton_dispatch;
#ifdef SKELETON_PUBLIC
AddClass(class);
#endif
return(class);
}
ULONG Skeleton_free( Class *class )
{
#ifdef SKELETON_PUBLIC
RemoveClass(class);
#endif
return((ULONG) FreeClass(class) );
}